local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
-- hide error in center of the screen except for those we added in filter.

local db, f, o = C["error"], CreateFrame("Frame"), L.error_noerror
if not db.enable then return end

f:SetScript("OnEvent", function(self, event, error)
	if db.filter[error] then
		UIErrorsFrame:AddMessage(error, 1, 0 ,0)
	else
		o = error
	end
end)

SLASH_TUKUIERROR1 = "/error"
function SlashCmdList.TUKUIERROR() print(o) end

UIErrorsFrame:UnregisterEvent("UI_ERROR_MESSAGE")
f:RegisterEvent("UI_ERROR_MESSAGE")